<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<html>
<head>
    <meta charset="UTF-8">
    <title>g360</title>

    <link rel="icon" type="image/x-icon" href="${pageContext.request.contextPath}/resources/favicon.ico">

    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/resources/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resources/easyui/themes/icon.css">


    <script type="text/javascript" src="${pageContext.request.contextPath}/resources/js/jquery.min.js"></script>
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/resources/easyui/jquery.easyui.min.js"></script>
</head>
<body>

<input type="hidden" id="errorMsg" value="${error}">

<div id="win" class="easyui-window" title="g360">
    <form action="" id="loginFrom" method="post">
        <table cellpadding="5">
            <tr>
                <td>用户名:</td>
                <td><input class="easyui-textbox" type="text" value="<shiro:principal/>" name="username"
                           data-options="required:true"></td>
            </tr>
            <tr>
                <td>密码:</td>
                <td><input class="easyui-textbox" type="password" name="password"></td>
            </tr>
            <tr>
                <td>自动登录:</td>
                <td>
                    <input class="easyui-textbox" type="checkbox" value="true">
                </td>
            </tr>
        </table>
    </form>
    <div style="text-align:center;padding:5px">
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">登录</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">重置</a>
    </div>
</div>

<script>
    $(function() {
        $('#win').window({
            width : 313,
            height : 213,
            collapsible : false,
            minimizable : false,
            maximizable : false,
            closable : false,
            draggable : false,
            resizable : false
        });

        var errorMsg = $('#errorMsg').val();
        if(errorMsg) {
            $.messager.alert('提示',errorMsg,'info');
        }
    });
    function submitForm() {
        var $loginFrom = $('#loginFrom');
        if($loginFrom.form('validate')) {
            $loginFrom.submit();
        }
    }

    function clearForm() {
        $('#loginFrom').form('clear');
    }
</script>

</body>
</html>